<%@ page language="java" import="java.util.*,dao.*,dao.impl.*,entity.*" contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<!-- <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%> /css/style.css ">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%> /css/iconic.css ">
	 -->
	<link href="css/style.css" media="screen" rel="stylesheet" type="text/css" />
	<link href="css/iconic.css" media="screen" rel="stylesheet" type="text/css" /> 
	<link href="css/bookList.css" media="screen" rel="stylesheet" type="text/css" /> 

  </head>
  
  <body>
     <%
     String loginUser="";
     if(session.getAttribute("loginUser")!=null)
     {
       loginUser=session.getAttribute("loginUser").toString();
     }  
      %>
      欢迎你<font><%=loginUser%></font>,登录成功！
      <div class="wrap">
	
	<nav>
		<ul class="menu">
			<li><a href="login_reader.jsp"><span class="iconic home"></span>主页</a></li>
			
			<li><a href="#"><span class="iconic mail"></span>个人信息</a></li>
			<li><a href="#"><span class="iconic mail"></span>个人借阅记录</a></li>
			<li><a href="#"><span class="iconic mail"></span>更改密码</a></li>
			
		</ul>
		<div class="clearfix"></div>
	</nav>
	</div >
      <center>
    <table width="750" height="60" cellpadding="0" cellspacing="0" border="0">
      <tr>
        <td>
          
          <!-- 商品循环开始 -->
       <%
        IBookDao bookDao=new BookDaoImpl();
        List<Book> bookList = bookDao.findAllBook();
        if(bookList!=null&&bookList.size()>0)
        {
         for(int i=0;i<bookList.size();i++)
         {
            Book book = bookList.get(i);
           %>   
          <div class="bookList">
             <dl>
               <dt>
                 <a href="bookDetails.jsp?bookid=<%=book.getBookid()%>"><img src="images/00<%=i%>.jpg" width="120" height="90" border="1"/></a>
               </dt>
               <dd class="dd_name"><%=book.getBookname() %></dd> 
               <dd class="dd_city">作者:<%=book.getEditor() %>&nbsp;&nbsp;库存量: <%=book.getQty() %></dd> 
             </dl>
          </div>
          <!-- 商品循环结束 -->
        
          <%
                   }
              } 
          %>
        </td>
      </tr>
    </table>
    </center>
      
  </body>
</html>
